#include "StdAfx.h"
#include "tinyxml_helper.h"

std::string
get_xml_element_value(TiXmlElement* node)
{
    return (node->FirstChild() != NULL? node->FirstChild()->Value() : "");
}

int
get_xml_element_int_value(TiXmlElement* node)
{
    if ( node->FirstChild() != NULL )
    {
        std::string value = node->FirstChild()->Value();
        if (!value.empty())
        {
            return aot::tt::utility::StrConvert::ParseInt(value);
        }
    }
    return 0;
}

double
get_xml_element_double_value(TiXmlElement* node)
{
    if ( node->FirstChild() != NULL )
    {
        std::string value = node->FirstChild()->Value();
        if (!value.empty())
        {
            return aot::tt::utility::StrConvert::ParseDouble(value);
        }
    }
    return 0.0;
}